{% extends 'WebQuant/base.html' %}
<!-- {% block title %}云研究{% endblock %} -->
{% block content %}
<div class="wrap" style="display:none">
    <div id = tmp-username style="display:none">{{name}}</div>
    <form action="http://quant.999fin.com:8004/research/hub/login?next=" method="post" role="form" id="login-form" name="login-form">
        <input id = "username_input" type="username" name="username"/>
        <input type = "password" class="form-control" name="password" id="password_input"/>
        <input type="submit" id="login_submit" class="btn btn-jupyter" value="Sign in">
    </form>
</div><!-- 内容 -->


{% endblock %}
{% block bottom %}
<div class="pop pop_finish frameWrap none">
    <div class="pop_box login_box">
        <a class="pop_close" href="javascript:void(0);">
            <span class="txt">关闭</span>
        </a>
        <iframe class="frameItem" id="frameItem" src=""> </iframe>
    </div>
</div>
<script src="/static/WebQuant/js/jq.js"></script>
<script src="/static/WebQuant/js/csrf.js"></script>
<script src="/static/WebQuant/js/base.js"></script>

<script>
    var isLog = {{log}}

    if (isLog)
    {
        $(".l_case2").css("display","block");
        $(".l_case1").css("display","none");

        $.ajax({ xhrFields:{ withCredentials: true}, url: "http://118.178.34.236:8000/research/logout",success: function(data){
           console.log(data);
      }});

        setTimeout(function(){
            var username = $("#tmp-username").text();
            document.getElementById("username_input").value = "ipython"
            document.getElementById("password_input").value = "123456"
            document.forms["login-form"].submit()
        }, 50);
    }
    else
    {
        $(".l_case2").css("display","none");
        $(".l_case1").css("display","block");
        showLogin();
    }
</script>
{% endblock %}

